import { ref, computed, reactive } from "vue";
import { defineStore } from "pinia";

//角色信息状态机
interface UserInfo {
  userCode: string;
  username: string;
}

export const useUserInfoStore = defineStore("userInfo", () => {
  const userInfo = reactive<UserInfo>({
    userCode: "",
    username: "",
  });

  function set(data: any) {
    userInfo.userCode = data.userCode;
    userInfo.username = data.username;
  }

  return { userInfo, set };
});


